﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="tagSearch.aspx.vb" Inherits="WuggiSum.tagSearch" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
    <ItemTemplate>
        
        <a href="tagSearch.aspx?tag=<%# Eval("t_names") %>"><%# Eval("t_names")%> </a> &nbsp; | &nbsp;
        
        </ItemTemplate>
    </asp:Repeater>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [t_names] FROM [tags]"></asp:SqlDataSource>
    <br />
    <hr />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="m_id" DataSourceID="WugSource" Width="100%" AllowSorting="True" AlternatingRowStyle-BackColor="#E6E6E6" AllowPaging="True">
            <Columns>
                <asp:HyperLinkField DataNavigateUrlFields="m_id" DataNavigateUrlFormatString="details.aspx?WuggiQuery={0}" DataTextField="m_title" HeaderText="Title" SortExpression="m_title" />
                <asp:ImageField DataImageUrlField="m_poster" DataImageUrlFormatString="/Images/{0}" HeaderText="Poster's Thumbnail">
                    <ControlStyle CssClass="Thumbnails"> </ControlStyle> 
                    <ItemStyle HorizontalAlign="Center" />
                </asp:ImageField>
                <asp:BoundField DataField="m_pg" HeaderText="PG Rating" SortExpression="m_pg" />
                <asp:BoundField DataField="m_year" HeaderText="Year" SortExpression="m_year" />
                <asp:BoundField DataField="s_genre" HeaderText="Subgenre" SortExpression="s_genre" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="WugSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
        SelectCommand="SELECT [m_id], [m_title], [m_desc], [m_pg], [m_starring], [m_poster], [m_year], [sub_id], [t_names], [m_duration], [m_addby], [m_date], [s_genre] FROM [moviestags] WHERE ([t_names] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="t_names" QueryStringField="tag" 
                    Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>

</asp:Content>
